#ifndef PARSEDATATHREAD_H
#define PARSEDATATHREAD_H

#include <QObject>
#include <QDebug>
#include <QDateTime>
#include <QTimer>
#include "header.h"
#include "jlog.h"

class ParseDataThread : public QObject
{
    Q_OBJECT
public:
    explicit ParseDataThread(QObject *parent = NULL);

    static DateTimeInfo GetCurrentDateTime();

private:
    QVector<double> DisplayData[CHANNELCOUNT];
    QVector<double> DisplayDataBuf[CHANNELCOUNT];
    int DataTimes;
    DateTimeInfo DTInfo;

    void Init();
    float ParseData(int Ch, unsigned int SrcCode);

signals:
    void SendData(DateTimeInfo time, QVector<float>* data);
    void SendDisplayDate(QVector<double> *data);
    void SendDisplayDate(QVector<double> *data, float *MaxValue);
    void SendNoiseValue(float *data);
    void TrigDataTip();      // 触发数据保存提示

public slots:
    void ReceiveData(QByteArray DataBuf);
};

#endif // PARSEDATATHREAD_H
